//
//  UITextViewExtension.swift
//  NightNews
//
//  Created by 薛永伟 on 2019/8/27.
//  Copyright © 2019 XueYongWei. All rights reserved.
//

import UIKit

extension UITextView{
    
    func setPlaceHolder(holder:String,color:UIColor){
        
        if let holderLabel = self.value(forKey: "_placeholderLabel"){
            
        }else{
            let label = UILabel()
            label.textColor = color
            label.font = self.font
            label.text = holder
            label.numberOfLines = 0
            label.sizeToFit()
            self.addSubview(label)
            self.setValue(label, forKey: "_placeholderLabel")
        }
    }
}
